const { resolve } = require("./../utils");
module.exports = [
  {
    test: /\.(j|t)sx?$/,
    use: [
      {
        loader: "cache-loader",
        options: {
          cacheDirectory: resolve(".cache-loader"),
        },
      },
      {
        loader: "babel-loader",
        options: {
          babelrc: false,
          presets: [
            [
              "@babel/preset-env",
              {
                corejs: "2",
                useBuiltIns: "entry",
              },
            ],
            "@babel/preset-typescript",
            "@babel/preset-react",
            "mobx",
          ],
          plugins: [
            [
              "@babel/plugin-proposal-decorators",
              {
                legacy: true,
              },
            ],
            [
              "@babel/plugin-proposal-class-properties",
              {
                loose: false,
              },
            ],
            [
              "@babel/plugin-transform-private-property-in-object",
              { loose: false },
            ],
            "@babel/plugin-syntax-dynamic-import",
          ],
        },
      },
    ],
    exclude: /node_modules/,
  },

  {
    test: /\.html$/,
    use: "raw-loader",
  },
];
